Understanding Brunei’s Climate Through Air Temperature Data (Ongoing Project)

Author

Alvin Bong

To do:

✅ Feel lack rigor/indepth analysis, mostly EDA for now, consult Dr. Haziq for advice.
Advice: Since interdiscipline field, need to consult geography background experts, to check if I am asking the right questions.
✅ Discussed with senior Amir , gained ideas on project outline (similar to his ongoing project on rainfall analysis.)

1 Research Question

Climate change has been prevalent worldwide, causing adverse effects felt by all. Given temperature being one of the most important indicators of climate change, it would be interesting to explore:

  • How has Brunei’s temperature evolved over time?
  • Is this consistent with global temperature trends?
  • How temperature varies by month?

2 Data Collection and Cleaning

2.1 Data Collection

The dataset is sourced from NASA POWER API using {nasapower} package in R, covering years 1981 to 2023.

Code
df <- get_power(
  community = "re",
  lonlat = c(114.9, 4.9),
  pars = c("T2M", "T2M_MAX", "T2M_MIN", "TS", "TS_MAX", "TS_MIN"),
  dates = c("1981-01-01", "2023-12-31"),
  temporal_api = "monthly"
)

write.csv(df, "brunei_temp.csv", row.names = FALSE)

2.2 Data Wrangling

df <- read_csv("brunei_temp.csv")
df <- df %>% 
    pivot_longer(cols = 5:16, names_to = "MONTH") %>% 
    select(-ANN, -LON, -LAT) %>% 
    spread(PARAMETER, value)
df$DATE <- ymd(paste(df$YEAR, df$MONTH, "01"))

# add anomalies
monthly_means <- df %>% 
  group_by(MONTH) %>% 
  summarise(T2M_mean = mean(T2M))

df <- df %>%
  left_join(monthly_means, by = "MONTH") %>%
  mutate(anomaly = T2M - T2M_mean) %>% 
  arrange(DATE)

t2m_ts <- ts(df$T2M, start = c(1981, 1), frequency = 12)

2.3 Variable of interest

NASA provides two temperature-related variables: T2M (temperature at 2 meters) and TS (surface temperature). A comparison shows that both are highly correlated, making one sufficient for analysis. Since T2M better represents the temperature experienced by a person, this project uses T2M. However, using TS would likely yield similar results.

3 EDA

3.1 Monthly Distribution

From Figure 1, we see that temperature are highest from April to September, with a peak in May, indicating the warmest part of the year. A general cooling trend is observed in the last quarter of the year, with an abrupt temperature drop from December to January. This marks the transition into the coolest part of the year, spanning January to March. During this three months, the average temperature drops below 27°C.

Another significant observation is that the Range and Interquartile Range (IQR) seems widest in November and January, suggesting higher variability and less consistent temperatures during these months. This could indicate transitional weather patterns.

Figure 1

3.2 Yearly & Monthly Trend

Although air temperature appears relatively stable in Figure 2, with quite consistent seasonal cycles, Figure 3 reveals a gradual upward trend. Prior to 1990, temperatures hovered around or below 27°C, but in recent years have exceeded 27.5°C. While this may seem negligible, it amounts to approximately 0.9°C over a 50-year period (assuming the current rate of change holds). This is supported by a linear regression model, which yields a small p-value of \(3.64 \times 10^{-10} < 0.01\) and a Pearson correlation coefficient of \(\sqrt{0.6207} \approx 0.788\), indicating a moderate to strong positive trend over time and supporting the alternative hypothesis of increasing temperature.

WWhile linear regression may not be the most accurate model for capturing long-term trends due to autocorrelated residuals (temperature of consecutive months may be related), violating the independence assumption, it still offers valuable insight into the general general direction of temperature changes over time.

Additionally, from Figure 2 and Figure 3, we observe temperature peaks in 1998, 2016, 2019 and 2023. Notably, the annual plot (Figure 3) appears to have fewer peaks compared to the monthly plot (Figure 2), likely due to monthly autocorrelation smoothing out short-term extremes into broader yearly trends. Nevertheless, the present of temperature peaks raises some important questions: What are the periodicities (cycle lengths) of Brunei’s air temperature anomalies? Do the anomalies align with the El Niño-Southern Oscillation (ENSO) cycle?

Figure 2: Monthly T2M (1981-2023)
Figure 3: Annual Mean T2M (1981-2023)
lm_temp <- lm(T2M ~ YEAR, 
              data = df %>% 
                select(YEAR, T2M) %>% 
                group_by(YEAR) %>% 
                summarize(T2M = mean(T2M)))
summary(lm_temp)

Call:
lm(formula = T2M ~ YEAR, data = df %>% select(YEAR, T2M) %>% 
    group_by(YEAR) %>% summarize(T2M = mean(T2M)))

Residuals:
     Min       1Q   Median       3Q      Max 
-0.47319 -0.14064 -0.00593  0.11482  0.48698 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) -8.987713   4.420146  -2.033   0.0485 *  
YEAR         0.018083   0.002208   8.190 3.64e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1797 on 41 degrees of freedom
Multiple R-squared:  0.6207,    Adjusted R-squared:  0.6114 
F-statistic: 67.08 on 1 and 41 DF,  p-value: 3.635e-10

4 Findings

4.1 Spectrum Analysis

Spectral analysis of the deseasonalized, detrended temperature anomalies (Figure 4), revealed periodicities at approximately 18, 29, 37, 65, and 86 months, with the dominant cycle at 43 months. This 43-month (\(\approx\) 3.6 years) cycle falls within the typical ENSO range of 2–7 years, suggesting a potential alignment with the ENSO cycle. The presence of multiple peaks indicates that ENSO-driven cycles in Brunei’s temperature data are not uniform but vary within the 2–7 year range, reflecting the irregular timing of ENSO events. To further verify this alignment with ENSO, we explore linear regression and cross-correlation methods in the next section.

Figure 4: Spectral Analysis of Detrend Temperature Anomalies

4.2 Anomalies vs ENSO

5 Conclusion

This project can be summarised in three main points:

  • Temperature is gradually increasing in Brunei.

  • Brunei is not immune to El Niño effects. Extreme heat in 1998 & 2023 (aligning with global anomalies)

  • May is the hottest month in Brunei.

6 Acknowledgements

The author expresses gratitude to NASA POWER for the data used in the project.